package service.impl;

import dao.NoticeMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import pojo.Notice;
import service.NoticeService;

import java.util.List;

@Service
public class NoticeServiceImpl implements NoticeService {

    @Autowired
    private NoticeMapper noticeMapper;

    @Override
    public List<Notice> findAll() {
        return noticeMapper.findAll();
    }

    @Override
    public int add(Notice notice) {
        return noticeMapper.addNotice(notice);
    }

    @Override
    public int update(Notice notice) {
        return noticeMapper.updateNotice(notice);
    }

    @Override
    public int deleteNotice(Integer id) {
        return noticeMapper.deleteNotice(id);
    }

    @Override
    public Notice findById(Integer id) {
        return noticeMapper.findById(id);
    }
}